package com.fly;

import org.springframework.context.support.GenericXmlApplicationContext;

import com.fly.demo.service.UserService;

import lombok.extern.slf4j.Slf4j;

/**
 * 
 * Main
 * 
 * @author 00fly
 * @version [版本号, 2017-4-16]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
@Slf4j
public class MainRun
{
    /**
     * Main
     * 
     * @param args
     * @throws ServiceException
     * @throws DaoException
     * @see [类、类#方法、类#成员]
     */
    public static void main(String[] args)
    {
        GenericXmlApplicationContext context = new GenericXmlApplicationContext();
        context.setValidating(false);
        context.load("classpath*:application*.xml");
        context.refresh();
        try
        {
            UserService usersService = context.getBean(UserService.class);
            log.info("data: {}", usersService.findAll());
        }
        catch (Exception e)
        {
            log.error(e.getMessage(), e);
        }
        context.close();
    }
}